\(\int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx\) [27]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 17 \[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=-\frac {\cot (x) \log (\cos (x))}{\sqrt {a \cot ^2(x)}} \]

[Out]

-cot(x)*ln(cos(x))/(a*cot(x)^2)^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3739, 3556} \[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=-\frac {\cot (x) \log (\cos (x))}{\sqrt {a \cot ^2(x)}} \]

[In]

Int[1/Sqrt[a*Cot[x]^2],x]

[Out]

-((Cot[x]*Log[Cos[x]])/Sqrt[a*Cot[x]^2])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3739

Int[(u_.)*((b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Tan[e + f*x]^n)^FracPart[p]/(Tan[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Tan[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \frac {\cot (x) \int \tan (x) \, dx}{\sqrt {a \cot ^2(x)}} \\ & = -\frac {\cot (x) \log (\cos (x))}{\sqrt {a \cot ^2(x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=-\frac {\cot (x) \log (\cos (x))}{\sqrt {a \cot ^2(x)}} \]

[In]

Integrate[1/Sqrt[a*Cot[x]^2],x]

[Out]

-((Cot[x]*Log[Cos[x]])/Sqrt[a*Cot[x]^2])

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.53

method result size
derivativedivides \(\frac {\cot \left (x \right ) \left (\ln \left (\cot \left (x \right )^{2}+1\right )-2 \ln \left (\cot \left (x \right )\right )\right )}{2 \sqrt {a \cot \left (x \right )^{2}}}\) \(26\)
default \(\frac {\cot \left (x \right ) \left (\ln \left (\cot \left (x \right )^{2}+1\right )-2 \ln \left (\cot \left (x \right )\right )\right )}{2 \sqrt {a \cot \left (x \right )^{2}}}\) \(26\)
risch \(-\frac {\left ({\mathrm e}^{2 i x}+1\right ) x}{\sqrt {-\frac {a \left ({\mathrm e}^{2 i x}+1\right )^{2}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}-\frac {i \left ({\mathrm e}^{2 i x}+1\right ) \ln \left ({\mathrm e}^{2 i x}+1\right )}{\sqrt {-\frac {a \left ({\mathrm e}^{2 i x}+1\right )^{2}}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}}\, \left ({\mathrm e}^{2 i x}-1\right )}\) \(94\)

[In]

int(1/(a*cot(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*cot(x)*(ln(cot(x)^2+1)-2*ln(cot(x)))/(a*cot(x)^2)^(1/2)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (15) = 30\).

Time = 0.25 (sec) , antiderivative size = 45, normalized size of antiderivative = 2.65 \[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=-\frac {\sqrt {-\frac {a \cos \left (2 \, x\right ) + a}{\cos \left (2 \, x\right ) - 1}} \log \left (\frac {1}{2} \, \cos \left (2 \, x\right ) + \frac {1}{2}\right ) \sin \left (2 \, x\right )}{2 \, {\left (a \cos \left (2 \, x\right ) + a\right )}} \]

[In]

integrate(1/(a*cot(x)^2)^(1/2),x, algorithm="fricas")

[Out]

-1/2*sqrt(-(a*cos(2*x) + a)/(cos(2*x) - 1))*log(1/2*cos(2*x) + 1/2)*sin(2*x)/(a*cos(2*x) + a)

Sympy [F]

\[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=\int \frac {1}{\sqrt {a \cot ^{2}{\left (x \right )}}}\, dx \]

[In]

integrate(1/(a*cot(x)**2)**(1/2),x)

[Out]

Integral(1/sqrt(a*cot(x)**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.43 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.71 \[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=\frac {\log \left (\tan \left (x\right )^{2} + 1\right )}{2 \, \sqrt {a}} \]

[In]

integrate(1/(a*cot(x)^2)^(1/2),x, algorithm="maxima")

[Out]

1/2*log(tan(x)^2 + 1)/sqrt(a)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.12 \[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=-\frac {\log \left ({\left | \cos \left (x\right ) \right |}\right )}{\sqrt {a} \mathrm {sgn}\left (\cos \left (x\right )\right ) \mathrm {sgn}\left (\sin \left (x\right )\right )} \]

[In]

integrate(1/(a*cot(x)^2)^(1/2),x, algorithm="giac")

[Out]

-log(abs(cos(x)))/(sqrt(a)*sgn(cos(x))*sgn(sin(x)))

Mupad [B] (verification not implemented)

Time = 11.51 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.47 \[ \int \frac {1}{\sqrt {a \cot ^2(x)}} \, dx=-\frac {\mathrm {atan}\left (\frac {\sqrt {-a}\,\mathrm {cot}\left (x\right )}{\sqrt {a}\,\sqrt {{\mathrm {cot}\left (x\right )}^2}}\right )}{\sqrt {-a}} \]

[In]

int(1/(a*cot(x)^2)^(1/2),x)

[Out]

-atan(((-a)^(1/2)*cot(x))/(a^(1/2)*(cot(x)^2)^(1/2)))/(-a)^(1/2)